import { createRouter, createWebHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    name: 'Home',
    component: ()=>import('../views/Home'),
    meta:{
      title:'首页'
    }
  },
  {
    path: '/classify',
    name: 'Classify',
    component: () => import( '../views/Classify.vue'),
    meta:{
      title:'分类'
    }
  },
  {
    path:'/personal',
    name:'Personal',
    component:()=>import('../views/Personal.vue'),
    meta:{
      title:'个人中心'
    }
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

// router.beforeEach((to,from,next)=>{
//   console.log('to=>',to)
//   console.log('from=>',from)
//   next()
// })

export default router
